<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*,java.sql.*,com.vo.*" %>
<jsp:useBean id="RsDao" scope="page" class="com.dao.Dao"></jsp:useBean>

<%@ page buffer="16kb" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
<head>

<meta http-equiv="keyword" content="商品信息管理系统">
<title>图书信息查询界面</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
  p{
    text-align:center;
  }
</style>
<script type="text/javascript" src="DateJs/checkct.js"></script>
<script type="text/javascript" src="DateJs/WdatePicker.js"></script>
</head>
<body >
   <form action="Servlet" method="post" name="formsea">
 <tr align="center" valign="middle" class="font">

      <td colspan="2" height="40" style="height: 51px; ">图书类别：<input type="text" name="bookName" value="">
          <input type="hidden" name="domethod" value="searchbook" >
        
      
<input type="submit" value="查询数据" />    
  </form>
<form name="form1" method="post" action="">
	
  <table width="90%" border="1px" align="center" cellpadding="1" cellspacing="0" bordercolor="#000000" class="table">
    <caption>
    <h1>图书信息列表</h1>
    </caption>   
  
    </tr>    
    
        
    <tr class="tr">
     <th width="15%" class="td">类别</th>
	  <th width="25%" class="td">图书编号</th>
      <th width="20%" class="td">图书名称</th>
      <th width="15%" class="td">价格</th>
      <th width="15%" class="td">库存</th>
        
       <th width="15%" class="td">操作</th>
    
    </tr>  
          
<%
	int curPage=0;
	int rowCounts=0;
	int pageTotal=0;
 	List list=(List)request.getAttribute("resultList");	
	

 	if(list!=null && list.size()!=0){	 
 		for(int i=0;i<list.size();i++){ 
 			Book vo = (Book)list.get(i); 
 			//String stuid=String.valueOf(vo.getId()); 
%>

    <tr class="tr">
    
     <td class="td"><%=vo.getBookClass() %></td>
        <td class="td"><%=vo.getId() %></td>
      <td class="td"><%=vo.getBookName() %></td>
      <td class="td"><%=vo.getBookPrice() %></td>
       <td class="td"><%=vo.getBookNum() %></td>
       
	  <td  >
	   <a href="<%=basePath%>Servlet?domethod=bookedit&id=<%=vo.getId()%>"><input name="buttonedit" type="button" id="idedit" class="buttoncss" value="修改"></a> 
	  	   <a href="<%=basePath%>Servlet?domethod=bookdelete&id=<%=vo.getId()%>"><input name="buttonedit" type="button" id="idedit" class="buttoncss" value="删除"></a> 
	  
	  </td>
      </td>     
	</tr>  
<%  } } 
else {%>
  	<tr align="center" valign="middle" class="tr">
  	<td height="35" width="100%" colspan="12" class="td"><font color="red">查询的内容没有相关记录!</font></td>
  	</tr>
<% } %> 
  </table>
  <p>
	
  </p>
  
<p>

    <label>
	  <input name="buttondelete" type="button" id="iddelete" class="buttoncss" value="删除数据" onClick="studelete()">
    </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <label>
    <a href="<%=basePath%>/bookadd.jsp"><input name="buttonReg" type="button" class="buttoncss" value="图书登记" ></a>
    </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <label>
    
    </label>
</p>

<input type="hidden" name="domethod">

</form>
</body>
</html>